<?php

class JSCasts_Path_Directory
extends JSCasts_Path_Abstract 
{
    private $delimiter = DIRECTORY_SEPARATOR;
    private $delimiterPrefix = true;
    private $delimiterSuffix = true;
    
    public function validate()
    {
        return file_exists($this->__toString());
    }

    public function __toString()
    {
        $out = '';
        
        if ($this->delimiterPrefix) {
            $out .= $this->delimiter;
        }
        
        $out .= parent::__toString();
        
        if ($this->delimiterSuffix) {
            $out .= $this->delimiter;
        }
        
        return $out;
    }
}